package se.webbzon.boltzmann.game.event;

import se.webbzon.boltzmann.game.sequence.Sequence;
import se.webbzon.oschi01.worldarea.WorldArea;
import se.webbzon.oschi01.worldobject.WorldObject;

public class SetTargetEvent extends AbstractGameEvent {
	
	// The sequence associated with this event
	private final Sequence sequence;
	
	// The binding associated with this event
	private final WorldObject binding;
	
	/*============================================================
	Constructors
	============================================================*/
	
	public SetTargetEvent(Sequence sequence, WorldObject binding, String[] arguments) {
		super(arguments);
		this.sequence = sequence;
		this.binding = binding;
	}
	
	/*============================================================
	Public Methods
	============================================================*/

	@Override protected void onBegin(WorldArea world) {
		sequence.bindTo(getArgument(0), binding);
		end();
	}

	@Override protected void onEnd() {};

}
